]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Remove "disable" file on shutdown
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 12 Jun 2023 21:28:54 +0000 (23:28 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 7 Jul 2023 11:34:44 +0000 (11:34 +0000)
The file indicates to the systemd shutdown scripts that extensions
should be disabled, so that extensions that crash the shell on
startup cannot lock out the user indefinitely.

For that purpose, we create the file before initializing extensions,
and remove it after 60 seconds. That generally works, because it's
highly unlikely that a session genuinely ends within the first minute.

It's possible though (for example during developments or when running
tests), so also remove the file when shutting down cleanly before
the timeout.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2807>

js/ui/extensionSystem.js

index 84c85f0424d44cb6f89eaed6f7b72983ac998781..222ac05ed494d3d5c6bc3361c583f9b981c72ebb 100644 (file)
@@ -57,7 +57,12 @@ var ExtensionManager = class extends Signals.EventEmitter {
             log(`Failed to create file ${disableFilename}: ${e.message}`);
         }
 
+        const shutdownId = global.connect('shutdown',
+            () => disableFile.delete(null));
+
         GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 60, () => {
+            global.context.disconnect(shutdownId);
+
             disableFile.delete(null);
             return GLib.SOURCE_REMOVE;
         });